<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::controller('/home/index','Home\IndexController');


Route::get('/home/enterprise/reglogin', 'Home\LoginRegController@reglogin');
Route::post('/home/enterprise', 'Home\EnterpriseController@index');
Route::post('/home/enterprise/doregisterproc', 'Home\LoginRegController@doregisterproc');
Route::post('/home/enterprise/changes/{id}', 'Home\EnterpriseController@changes');

Route::post('/home/enterprise/jobs', 'Home\EnterpriseController@jobs');
Route::post('/home/enterprise/jobs/jobschang', 'Home\EnterpriseController@jobschang');
Route::post('/home/enterprise/jobs/paystatus', 'Home\EnterpriseController@paystatus');

Route::group(['middleware' => 'loginEnterprise'],function(){
	// 前台企业用户路由 /home/enterprise/doregisterproc
	
	Route::get('/home/enterprise/{id}', 'Home\EnterpriseController@indexe');
	// Route::post('/home/enterprise/doregisterproc', 'Home\EnterpriseController@doregisterproc');
	Route::get('/home/enterprise/myjobs/{id}', 'Home\EnterpriseController@myjobs');
	Route::get('/home/enterprise/modify/{id}', 'Home\EnterpriseController@modify');
	Route::get('/home/enterprise/img/{img}', 'Home\EnterpriseController@img');

	// 职位相关方法
	Route::get('/home/enterprise/jobs/index/{id}', 'Home\EnterpriseController@jobsindex');
	Route::get('/home/enterprise/jobs/view/{eid}/{id}', 'Home\EnterpriseController@jobsview');
	Route::get('/home/enterprise/jobs/modify/{eid}/{id}', 'Home\EnterpriseController@jobsmodify');
	Route::get('/home/enterprise/jobs/pay/{eid}/{id}', 'Home\EnterpriseController@jobspay');

	
	Route::post('/home/enterprise/jobs/del/{eid}', 'Home\EnterpriseController@del');
	
	// 简历方法
	Route::get('/home/enterprise/resumes/{id}', 'Home\EnterpriseController@resumesindex');
	Route::get('/home/enterprise/resumes/status/{eid}/{id}/{mode}', 'Home\EnterpriseController@status');
	Route::get('/home/enterprise/logout/{eid}', 'Home\EnterpriseController@loginout');
});
// 简历搜索
// Route::get('/home/enterprise/search/{id}', 'Home\EnterpriseController@search');
// Route::post('/home/enterprise/searchr', 'Home\EnterpriseController@searchr');


Route::group(['middleware' => 'login'],function(){
	// 后台的首页控制器
	Route::get('/admin/index','Admin\IndexController@index');
	Route::get('/admin/','Admin\IndexController@index');
	// 用户管理
	Route::get('/admin/user/add','Admin\UserController@add');
	Route::post('/admin/user/insert','Admin\UserController@insert');
	Route::get('/admin/user/index','Admin\UserController@index');
	Route::post('/admin/user/ajaxUpdate','Admin\UserController@ajaxUpdate');
	Route::post('/admin/user/ajaxName','Admin\UserController@ajaxName');
	Route::get('/admin/user/edit/{id}','Admin\UserController@edit');
	Route::post('/admin/user/update','Admin\UserController@update');
	Route::get('/admin/user/delete/{id}','Admin\UserController@delete');

		// 企业控制器
		Route::get('/admin/enterprise/index','Admin\EnterpriseController@index');
		Route::post('/admin/enterprise/ajaxAuthEntication','Admin\EnterpriseController@ajaxAuthEntication');
		Route::post('/admin/enterprise/authentication','Admin\EnterpriseController@authentication');

		Route::get('/admin/enterprise/detail/{id}','Admin\EnterpriseController@detail');
		Route::get('/admin/enterprise/delete/{id}','Admin\EnterpriseController@del');
		// 企业职位审核
		Route::get('/admin/enterprise/jobs/index','Admin\EnterpriseController@jobsindex');
		Route::post('/admin/enterprise/jobs/ajaxjobs','Admin\EnterpriseController@ajaxjobs');
		Route::post('/admin/enterprise/jobs/status','Admin\EnterpriseController@jobsstatus');

		Route::get('/admin/enterprise/jobs/detail/{id}','Admin\EnterpriseController@jobsdetail');

	// 分类管理
	Route::resource('/admin/cate','Admin\CateController');
	Route::resource('/admin/industrycate','Admin\IndustryCateController');

	Route::post('/admin/regioncate/ajaxName','Admin\RegionCateController@ajaxName');
	Route::resource('/admin/regioncate','Admin\RegionCateController');
	// 商品管理
	Route::controller('/admin/goods','Admin\GoodsController');
	// 退出
	Route::get('/admin/loginout','Admin\LoginController@loginout');
});

// 登录
// 1. 路由  
Route::get('/admin/login','Admin\LoginController@login');
// 2. php artisan make:controller LoginController
// 去Login控制器写 login方法的代码
Route::post('/admin/dologin','Admin\LoginController@dologin');


Route::get('/kit/captcha/{rand}','Admin\KitController@captcha');

// 找回密码
Route::get('/admin/reset/forget','Admin\ResetController@forget');
Route::post('/admin/reset/sendmail','Admin\ResetController@sendmail');
Route::get('/admin/reset/inputpass/id/{id}/token/{token}','Admin\ResetController@inputpass');
Route::get('/admin/reset/info','Admin\ResetController@info');
Route::post('/admin/reset/updatepassword','Admin\ResetController@updatepassword');

